isamuch - 2MA Cross and Stop Lossสัญญาณซื้อ/ขาย : มาจาก Moving Average สองเส้นตัดกัน
Stop Loss : มาจากราคาต่ำสุด/สูงสุดของช่วงระหว่าง Moving Average สองเส้นตัดกันก่อนหน้ากับ Moving Average ตัดกันปัจจุบัน
스크립트에서 "stop loss"에 대해 찾기
Parabolic SAR Strategy With take profit and stop lossDo not make it too difficult!
This is my first strategy! I took the Parabolic SAR Strategy and added Stop Loss and Take profit, and I can see some fantastic results in 2h-3h-4h on some of the Crypto coins.
This is for training only, and I do not recommend using it as part of a trading bot, however, I do myself.
MultiPrice AlertThis is an alert script using Pinescript version 4. This enables one to set 5 alerts (1 StopLoss, 4 Targets), on 3 different symbols, at using a single alert in the UI.
Every visible line will only appear on the symbols that are selected. After setting targets when making an alert, select this indicator as a condition. Change the name to whatever you want, usually the names of the set of tickers.
The Alert message is dyanmic showing which Symbol with each type of alert, at whatever price.
Ability to disable the targets + symbols.
Alerts work by Stop Loss crossing under price and Targets Cross Over. Enabling the "Short" Targets reverses this.
The line that is being displayed is actually the price of the asset being moved over x number of bars. I have not found a way to plot a traditional horizontal line, as the code for it uses a fixed price.
As it being a user input, it is a variable. Any help with this would be appreicated.
Alerts are set to once per bar.
Known bug that sometimes if the prices that you set are inside the current candle stick, then your alert will immeaditally fire, either change the timeframe or let it fire and wait fo
After a target is hit, I reccomend setting the alert to 0 and REMAKING the alert. You MUST REMAKE THE ALERT AFTER ANY CHANGES. This script WILL NOT CHANGE ALERTS AS YOU CHANGE SETTINGS.
TradingView Alerts are not this smart , at least I haven't found a way to do this yet.
Anti-Volume Stop Loss multi timeframe [LM]Hello Traders,
I would like to introduce you fork of popular indicator Anti-Volume Stop Loss created by Buff Dormeier and cracked here on tradingview by @Rafka so shout out to him. I have tried to crack it myself as well as I'm big fan of Dormeier's work but it's not easy so really big thanks to Rafka
I have refactored original script and have included multi timeframe setting.
As its shown below you can select higher timeframe to track lower one:
Enjoy!
Bitlinc MARSI Study AST w/ Take Profit & Stop loss - beta 0.1This script is beta 0.1 - will update as soon as the script is tradable
This script is based on AST on a 10 minute timeframe. You can change the asset and the timeframe for any asset you want to trade, but for it to work correct ALL settings have to be testes in the Strategy section of the TradingView. Each assets and timeframe require a different mixture of settings. This is NOT a one settings fits all trading for all assets on any timeframe. Below are the settings and explanation on how it works.
How it fires a buy / sell:
The script will plot an RSI with upper and lower bands in a separate indicator window. The idea behind this script is to fire a LONG when MA crosses OVER lower band and fire a SHORT when the MA crosses under the lower band. Each order that fires is an OCO (Order Cancels Order) for pyramiding.
Settings:
You have full control of these settings as mentioned above, you must configure every part of this script for each asset and timeframe you trade.
- Length of MA
- Length
- Upper bands of RSI
- Lower bands of RSI
- Take profit percentage
- Stop loss percentage
- Month to start and end the strategy (within 2020)
- Day to start and end the strategy (within 2020)
- Quantity type
- Slippage
- Pyramiding
***Remember that after the signal to enter or exit a trade is fired, the alert will trigger AFTER the close of the candle that caused the tigger to fire
ATR Stop Loss LONG/SHORT by melihgulerYou can monitor the stop loss level according to ATR in 2 ways (Long/Short).
RSI + EMA+ MTF Stop-LossThis is a simple RSI with multiple MTF (No security) to help with direction short and long-term.
The rsi for the current chart has a noise reduction, while the rest are based on ma's.
I have supplied an extra flexible mtf rsi ma for potential adjustable/long-term stop-loss or direction identification.
Enjoy
RSI Stop LossExperiment for using RSI as a stop loss value, shows where the price will be when the RSI increases or decreases by a specified amount.
poki buy and sell Take profit and stop lossThis indicator is based on modelius model of lazy bear weis model with ATR for the buy=B sell =S
in addition there is Take profit and stop loss in % both for short and for long
next stage is to know the resistance level and support based on bollinger marked in blue and red dots
Also included Parabolic Sar (blue and red dots rising up or down)
The color of bulish or bearish zone is based on the cross of Hull avreage and linear regression ( for each time set may need different setting for accuracy )
So how to use this scrupt to better profit
1. if you have B signal and its on lower support level then its good starting place for buy. look at the Parabolic Sar if its in agreement. The exit can be either by S =sell, Take profit that you decide on % or by end of Parabolic SAR upward
2. exact the oposite for short
Play with setting for the desired results or change modify this script for your purpose
Pivot Stop LossHere we intend to use pivot points for stop loss and take profit. This has the added benefit of helping you to visualize support and resistance levels.
Hull modelius take profit and stop lossThis model has Hull moving average, fibs in form of Bollinger ,SMA and Modelius model with ATR for buy and sell power based on weis volume. Inside alerts for buy and sell. take profit and stop loss for both longs and shorts
so have fun
SL + TP Dynamics - By M.LolasStop Loss e Take Profit dinâmicos para operações semiautomatizadas.
By M.Lolas
STOP-LOSS-RSI with Edge-Preserving Filter Strategy V2Modified RSI strategy with entry and exit points.
I have allowed for High and Low risk for anyone interested in using it (NO GUARANTEES. DO YOUR OWN RESEARCH).
I will later consider incorporating the standard RSI for exit points. I am sure returns will increase based on current test runs :)
Returns look good based on the strategy result.
Delta Volume EMA Strategy
================================================================================
DELTA VOLUME EMA STRATEGY - STRATEGY GUIDE 📊
================================================================================
💡 COLLABORATION & SUPPORT
---------------------------
If you want to collaborate, have an idea for a strategy, or need help writing
or customizing code, send an email to burdytrader@gmail.com or send me a
message. Suggestions, ideas, and comments are always welcome! 🤝
================================================================================
⚠️ IMPORTANT: INSTRUMENT SELECTION 📈
-------------------------------------
This strategy performs BEST with instruments that have a centralized data flow,
such as Futures contracts. Centralized markets provide more accurate and
reliable volume data, which is essential for Volume Delta analysis to work
effectively.
Why Futures? 🎯
- Centralized exchange = Accurate volume data
- All trades flow through a single exchange
- Volume reflects true buying/selling pressure
- Better correlation between volume and price movements
While the strategy can work with other instruments (stocks, forex, etc.),
volume data quality may vary, which can affect the reliability of Volume Delta
signals. For optimal performance, use Futures contracts or other instruments
with centralized, high-quality volume data.
================================================================================
WHAT DOES THIS STRATEGY DO? 🎯
---------------------------
This strategy uses Volume Delta analysis combined with Exponential Moving
Averages (EMA) to identify high-probability trading opportunities. The Volume
Delta measures the difference between buying and selling pressure, helping to
identify when strong institutional or smart money movements occur. The strategy
automatically enters trades when volume delta reaches extreme levels, indicating
potential trend continuation or reversal points.
HOW IT WORKS? ⚙️
---------------
1. VOLUME DELTA CALCULATION 📈
The strategy calculates the Volume Delta using the following formula:
- Volume Ratio (v) = Current Volume / Previous Volume
- EMA of Close (mac) = EMA(Close, MA Length) × Volume Ratio
- EMA of Open (mao) = EMA(Open, MA Length) × Volume Ratio
- Volume Delta (vd) = mac - mao
The Volume Delta shows:
- Positive values (green) = Buying pressure (buyers are more active)
- Negative values (red) = Selling pressure (sellers are more active)
2. VOLUME DELTA MOVING AVERAGE 📊
The strategy calculates an EMA of the Volume Delta (vdma) to smooth out
fluctuations and identify the overall trend of buying/selling pressure:
- vdma = EMA(Volume Delta, EMA Length)
- When vdma is above zero = Overall buying pressure
- When vdma is below zero = Overall selling pressure
3. PERCENTILE-BASED ENTRY CONDITIONS 🎲
Instead of using fixed thresholds, the strategy uses percentile analysis to
identify extreme volume delta movements:
For LONG entries:
- Analyzes seller volumes (negative volume delta) over the lookback period
- Calculates the percentile threshold (default: 80th percentile)
- Enters LONG when volume delta becomes positive AND exceeds the threshold
- This indicates a strong shift from selling to buying pressure
For SHORT entries:
- Analyzes buyer volumes (positive volume delta) over the lookback period
- Calculates the percentile threshold (default: 80th percentile)
- Enters SHORT when volume delta becomes negative AND exceeds the threshold
- This indicates a strong shift from buying to selling pressure
4. POSITION SIZING 💰
The strategy offers two position sizing methods:
a) RISK VALUE (Fixed Risk in Dollars):
- Calculates position size based on a fixed dollar risk amount
- Formula: Position Size = Risk Amount / (Entry Price × Stop Loss %)
- Ensures consistent risk per trade regardless of price level
b) LOTS SIZE:
- Uses a fixed lot size for all trades
- Simple and straightforward approach
- Useful when you want consistent position sizes
5. TAKE PROFIT & STOP LOSS SETTINGS 🎯
The strategy offers flexible TP/SL configuration in three modes:
a) PERCENTAGE (%):
- TP/SL calculated as a percentage of entry price
- Example: 2% TP means entry price × 1.02 (for LONG) or × 0.98 (for SHORT)
- Adapts automatically to different price levels
b) CURRENCY:
- TP/SL set as a fixed currency amount
- Example: $100 TP means entry price + $100 (for LONG) or - $100 (for SHORT)
- Useful for instruments with consistent price movements
c) PIPS:
- TP/SL set as a fixed number of pips
- Automatically converts pips to price using the instrument's minimum tick
- Ideal for forex and other pip-based instruments
6. AUTOMATIC TRADE EXECUTION ⚡
When entry conditions are met:
- Opens a position (LONG or SHORT) at market price
- Automatically sets Take Profit and Stop Loss based on selected mode
- Sends an alert with all trade information
- Only one position at a time (waits for current position to close)
AVAILABLE PARAMETERS ⚙️
----------------------
1. MA LENGTH (Default: 10)
- Length of the Exponential Moving Average used for close and open prices
- Lower values = More sensitive to recent price action
- Higher values = More smoothed, less sensitive
2. EMA LENGTH (Default: 20)
- Length of the EMA applied to Volume Delta
- Controls the smoothing of the volume delta signal
- Lower values = Faster signals, more trades
- Higher values = Slower signals, fewer but potentially more reliable trades
3. POSITION SIZE MODE
- "Risk Value": Calculate position size based on fixed dollar risk
- "Lots Size": Use fixed lot size for all trades
4. FIXED RISK IN $ (Default: 50)
- Only used when Position Size Mode = "Risk Value"
- The dollar amount you're willing to risk per trade
- Strategy calculates position size automatically
5. LOT SIZE (Default: 0.01)
- Only used when Position Size Mode = "Lots Size"
- Fixed lot size for all trades
6. TAKE PROFIT MODE
- "%": Percentage of entry price
- "Currency": Fixed currency amount
- "Pips": Fixed number of pips
7. STOP LOSS MODE
- "%": Percentage of entry price
- "Currency": Fixed currency amount
- "Pips": Fixed number of pips
8. TAKE PROFIT / STOP LOSS VALUES
- Different input fields appear based on selected mode
- Configure TP and SL independently
9. VOLUME LOOKBACK PERIOD (Default: 20)
- Number of bars used to calculate percentile thresholds
- Lower values = More sensitive, adapts faster to recent conditions
- Higher values = More stable, uses longer-term statistics
10. PERCENTILE THRESHOLD (Default: 80%)
- The percentile level used to identify extreme volume delta movements
- 80% means: only enter when volume delta exceeds 80% of recent values
- Higher values = Fewer but potentially stronger signals
- Lower values = More frequent signals
VISUALIZATION 📊
---------------
The strategy displays on the chart:
1. VOLUME DELTA COLUMNS
- Green columns = Positive volume delta (buying pressure)
- Red columns = Negative volume delta (selling pressure)
- Height represents the magnitude of buying/selling pressure
2. VOLUME DELTA MA AREA
- Two overlapping area plots showing the smoothed volume delta
- Black area (base layer) for overall visualization
- Green area (when positive) = Overall buying pressure trend
- Red area (when negative) = Overall selling pressure trend
- Helps identify the dominant market sentiment
3. ZERO LINE
- Horizontal line at zero
- Helps visualize when buying/selling pressure crosses the neutral point
ALERTS 🔔
--------
When enabled, the strategy sends alerts when a trade is opened. The alert
message includes:
- Direction: "Buy" for LONG positions or "Sell" for SHORT positions
- Entry Price: The price at which the position was opened
- TP (Take Profit): The target profit price
- SL (Stop Loss): The stop loss price
Example alert message:
"Buy | Entry: 1.2050 | TP: 1.2250 | SL: 1.1950"
Alerts can be configured in TradingView to send notifications via email,
SMS, webhooks, or other platforms.
RECOMMENDED SETTINGS 🎯
-----------------------
To get started, you can use these settings:
STRATEGY PARAMETERS:
- MA Length: 10 (default)
- EMA Length: 20 (default)
- Volume Lookback Period: 20 (default)
- Percentile Threshold: 80% (default)
POSITION SIZING:
- Position Size Mode: "Risk Value" (for risk management)
- Fixed Risk in $: Adjust based on your account size (e.g., 1-2% of account)
- OR use "Lots Size" with 0.01 lots for small accounts
TAKE PROFIT & STOP LOSS:
- TP Mode: "%" (recommended for most instruments)
- SL Mode: "%" (recommended for most instruments)
- Take Profit (%): 2.0% (adjust based on your risk/reward preference)
- Stop Loss (%): 1.0% (adjust based on your risk tolerance)
For Forex:
- Consider using "Pips" mode for TP/SL
- Typical values: 20-50 pips TP, 10-30 pips SL
For Stocks/Indices:
- Use "%" mode for TP/SL
- Typical values: 2-5% TP, 1-2% SL
PRACTICAL EXAMPLE 📝
-------------------
Scenario: LONG Entry on EUR/USD
1. Market conditions:
- Price: 1.1000
- Volume Delta becomes strongly positive
- Volume Delta exceeds 80th percentile of recent seller volumes
2. Strategy calculates:
- Entry Price: 1.1000 (current close)
- Position Size Mode: "Risk Value"
- Fixed Risk: $50
- Stop Loss Mode: "%"
- Stop Loss: 1.0%
- Position Size = $50 / (1.1000 × 0.01) = 4.55 lots
3. Strategy opens position:
- Direction: LONG (Buy)
- Entry: 1.1000
- Take Profit: 1.1220 (2% above entry)
- Stop Loss: 1.0890 (1% below entry)
- Alert sent: "Buy | Entry: 1.1000 | TP: 1.1220 | SL: 1.0890"
4. Outcome scenarios:
- If price rises to 1.1220 → Take Profit hit (profit)
- If price falls to 1.0890 → Stop Loss hit (loss limited to $50)
IMPORTANT NOTE ⚠️
-----------------
This strategy is a technical analysis tool based on volume delta analysis.
Like all trading strategies, it does NOT guarantee profits. Trading involves
significant risks and you can lose money, including your entire investment.
Past performance does not guarantee future results.
Always:
- Use appropriate risk management
- Never risk more than you can afford to lose
- Test the strategy on historical data (backtesting) before using real money
- Start with small position sizes or paper trading
- Understand that no strategy works 100% of the time
- Consider market conditions, news events, and other factors
- Keep a trading journal to learn and improve
The author and contributors are NOT responsible for any losses incurred from
using this strategy. Trading decisions are your own responsibility. Profits
are NOT guaranteed, and losses are possible.
LICENSE 📄
---------
This code is open source and available for modification. You are free to use,
modify, and distribute this strategy. If you republish or share a modified
version, please kindly mention the original author.
================================================================================
Commodity Channel Index CCI + EMA strategy
================================================================================
COMMODITY CHANNEL INDEX CCI + EMA STRATEGY - STRATEGY GUIDE 📊
================================================================================
💡 COLLABORATION & SUPPORT
---------------------------
If you want to collaborate, have an idea for a strategy, or need help writing
or customizing code, send an email to burdytrader@gmail.com or send me a
message. Suggestions, ideas, and comments are always welcome! 🤝
I also develop automated trading codes for other trading platforms including:
- CTrader (C#)
- MetaTrader 4 (MQL4)
- MetaTrader 5 (MQL5)
If you need a strategy converted or developed for any of these platforms, feel
free to contact me!
================================================================================
⚠️ IMPORTANT: INSTRUMENT SELECTION 📈
-------------------------------------
This strategy performs BEST with currency pairs (forex). The CCI indicator
works particularly well in the forex market due to the nature of currency
movements and the effectiveness of the CCI in identifying overbought and
oversold conditions in trending markets.
Why Currency Pairs? 🎯
- CCI is highly effective in identifying reversals in forex markets
- Currency pairs show clear overbought/oversold patterns
- EMA filter (50/200) aligns well with major forex trends
- High liquidity ensures reliable signal execution
Performance Highlights:
In specific currency pairs, when properly configured, this strategy can achieve:
- Profit Factor: Over 2.0
- Win Rate: Up to 70%
- Particularly effective pairs: USDCAD, EURUSD, GBPJPY
While the strategy can work with other instruments (stocks, indices, commodities),
currency pairs provide the most consistent and reliable results. For optimal
performance, focus on major forex pairs with good liquidity and clear trending
characteristics.
================================================================================
WHAT DOES THIS STRATEGY DO? 🎯
---------------------------
This strategy combines the Commodity Channel Index (CCI) with Exponential
Moving Averages (EMA) to identify high-probability trading opportunities.
The strategy uses CCI crossovers with a smoothing moving average and filters
signals using EMA trend confirmation. The strategy automatically enters trades
when CCI crosses the smoothing MA in specific zones, indicating potential trend
reversals or continuations.
HOW IT WORKS? ⚙️
---------------
1. CCI CALCULATION 📈
The strategy calculates the Commodity Channel Index using:
- CCI = (Price - SMA(Price, length)) / (0.015 × Deviation(Price, length))
- Default length: 20 periods
- Source: HLC3 (typical price)
The CCI shows:
- Values above +100 = Overbought conditions
- Values below -100 = Oversold conditions
- Values around 0 = Neutral conditions
2. SMOOTHING MOVING AVERAGE 📊
A moving average is applied to the CCI to smooth out fluctuations:
- Types available: SMA, EMA, SMMA (RMA), WMA, VWMA
- Default: SMA with length 14
- Can be disabled (set to "None")
This smoothed line acts as a reference for crossover signals.
3. EMA TREND FILTER 🎯
Two EMAs are calculated on the CCI:
- EMA 50 (fast EMA)
- EMA 200 (slow EMA)
When the EMA filter is enabled:
- LONG signals only occur when EMA50 > EMA200 (uptrend confirmation)
- SHORT signals only occur when EMA50 < EMA200 (downtrend confirmation)
This filter can be enabled/disabled via the "Use EMA Filter" option.
4. ENTRY CONDITIONS 🎲
LONG ENTRY (Buy Signal):
- CCI crosses ABOVE the Smoothing MA (crossover)
- CCI is between Lower Level (-100) and Middle Level (0)
- EMA Filter: EMA50 > EMA200 (if filter enabled)
- No existing positions (or close opposite positions first)
SHORT ENTRY (Sell Signal):
- CCI crosses BELOW the Smoothing MA (crossunder)
- CCI is between Middle Level (0) and Upper Level (+100)
- EMA Filter: EMA50 < EMA200 (if filter enabled)
- No existing positions (or close opposite positions first)
5. POSITION MANAGEMENT 💰
The strategy uses a simple position management approach:
- Only ONE position at a time (no pyramiding)
- If a signal occurs in the opposite direction, closes existing position first
- Then opens new position in the new direction
- This prevents overexposure and simplifies risk management
6. TAKE PROFIT & STOP LOSS SETTINGS 🎯
The strategy uses percentage-based TP/SL:
- Take Profit: 1.0% (default, configurable)
- Stop Loss: 0.5% (default, configurable)
- Risk/Reward Ratio: 2:1 (TP is double the SL)
TP/SL are calculated once when the position opens and remain fixed.
AVAILABLE PARAMETERS ⚙️
-----------------------
CCI SETTINGS:
1. CCI Length (Default: 20)
- Period for CCI calculation
- Lower values = More sensitive to recent price action
- Higher values = More smoothed, less sensitive
2. CCI Source (Default: HLC3)
- Price source for CCI calculation
- Options: close, open, high, low, hlc3, hlcc4, ohlc4
3. CCI Lower Level (Default: -100)
- Lower boundary for LONG entry zone
- Typically -100 for oversold conditions
4. CCI Middle Level (Default: 0)
- Neutral level separating LONG and SHORT zones
5. CCI Upper Level (Default: +100)
- Upper boundary for SHORT entry zone
- Typically +100 for overbought conditions
SMOOTHING MA:
6. Type (Default: SMA)
- Moving average type: None, SMA, EMA, SMMA (RMA), WMA, VWMA
- Set to "None" to disable smoothing
7. Length (Default: 14)
- Period for smoothing MA
- Range: 7-28, step 7
EMA FILTER:
8. EMA 1 Length (Default: 50)
- Fast EMA period applied to CCI
9. EMA 2 Length (Default: 200)
- Slow EMA period applied to CCI
10. Use EMA Filter (Default: true)
- Enable/disable EMA trend filter
- When enabled: LONG only if EMA50 > EMA200, SHORT only if EMA50 < EMA200
RISK MANAGEMENT:
11. Take Profit (%) (Default: 1.0%)
- Profit target as percentage of entry price
- For LONG: Entry × (1 + TP%)
- For SHORT: Entry × (1 - TP%)
12. Stop Loss (%) (Default: 0.5%)
- Stop loss as percentage of entry price
- For LONG: Entry × (1 - SL%)
- For SHORT: Entry × (1 + SL%)
VISUALIZATION 📊
---------------
The strategy displays in a separate panel below the price chart:
1. CCI LINE
- Blue line showing the CCI value
- Oscillates around zero
2. SMOOTHING MA LINE
- Yellow line showing the smoothed CCI
- Reference line for crossover signals
3. CCI LEVEL LINES
- Red dashed line: Upper Level (+100)
- Green dashed line: Lower Level (-100)
- Yellow dashed line: Middle Level (0)
4. ENTRY SIGNALS
- Green cross: LONG entry signal (when CCI crosses above MA)
- Red cross: SHORT entry signal (when CCI crosses below MA)
RECOMMENDED SETTINGS 🎯
-----------------------
To get started, you can use these settings:
CCI SETTINGS:
- CCI Length: 20 (default)
- CCI Source: HLC3 (default)
- CCI Lower Level: -100 (default)
- CCI Middle Level: 0 (default)
- CCI Upper Level: +100 (default)
SMOOTHING MA:
- Type: SMA (default) or EMA for faster response
- Length: 14 (default)
EMA FILTER:
- EMA 1 Length: 50 (default)
- EMA 2 Length: 200 (default)
- Use EMA Filter: true (recommended for better signal quality)
RISK MANAGEMENT:
- Take Profit (%): 1.0% (adjust based on your risk/reward preference)
- Stop Loss (%): 0.5% (adjust based on your risk tolerance)
For more aggressive trading:
- Reduce CCI Length to 14-16
- Reduce Smoothing MA Length to 7
- Disable EMA Filter
For more conservative trading:
- Increase CCI Length to 24-30
- Increase Smoothing MA Length to 21-28
- Keep EMA Filter enabled
RECOMMENDED CURRENCY PAIRS 💱
------------------------------
This strategy is optimized for currency pairs and performs exceptionally well
on the following pairs when properly configured:
TOP PERFORMING PAIRS:
- USDCAD: Can achieve Profit Factor > 2.0 and Win Rate up to 70%
- EURUSD: Excellent performance with consistent signals
- GBPJPY: Strong results with proper EMA filter configuration
These pairs have shown the best historical performance due to:
- Clear trending characteristics
- Good response to CCI overbought/oversold levels
- Strong alignment with EMA 50/200 trend filter
- High liquidity ensuring reliable execution
When trading these pairs, use the default settings or slightly adjusted
parameters based on the pair's volatility. Always backtest on historical
data before using real money to find the optimal configuration for each
specific pair.
PRACTICAL EXAMPLE 📝
--------------------
Scenario: LONG Entry on EUR/USD
1. Market conditions:
- Price: 1.1000
- CCI: -80 (in oversold zone)
- Smoothing MA: -90
- CCI crosses above Smoothing MA (crossover occurs)
- EMA50: -50, EMA200: -70 (EMA50 > EMA200, uptrend confirmed)
2. Strategy checks conditions:
✓ Smoothing MA enabled: Yes
✓ Crossover: Yes (CCI crosses above MA)
✓ CCI in range: Yes (-100 <= -80 <= 0)
✓ EMA Filter: Yes (EMA50 > EMA200)
✓ No existing position: Yes
3. Strategy opens position:
- Direction: LONG (Buy)
- Entry: 1.1000 (current close)
- Take Profit: 1.1110 (1.0% above entry)
- Stop Loss: 1.0945 (0.5% below entry)
- Risk/Reward: 2:1
4. Outcome scenarios:
- If price rises to 1.1110 → Take Profit hit (profit)
- If price falls to 1.0945 → Stop Loss hit (loss limited)
IMPORTANT NOTE ⚠️
-----------------
This strategy is a technical analysis tool based on CCI and EMA indicators.
Like all trading strategies, it does NOT guarantee profits. Trading involves
significant risks and you can lose money, including your entire investment.
Past performance does not guarantee future results.
Always:
- Use appropriate risk management
- Never risk more than you can afford to lose
- Test the strategy on historical data (backtesting) before using real money
- Start with small position sizes or paper trading
- Understand that no strategy works 100% of the time
- Consider market conditions, news events, and other factors
- Keep a trading journal to learn and improve
The author and contributors are NOT responsible for any losses incurred from
using this strategy. Trading decisions are your own responsibility. Profits
are NOT guaranteed, and losses are possible.
LICENSE 📄
----------
This code is open source and available for modification. You are free to use,
modify, and distribute this strategy. If you republish or share a modified
version, please kindly mention the original author.
================================================================================
TradingView.To Strategy Template (with Dyanmic Alerts)Hello traders,
If you're tired of manual trading and looking for a solid strategy template to pair with your indicators, look no further.
This Pine Script v5 strategy template is engineered for maximum customization and risk management.
Best part?
This Pine Script v5 template facilitates the dynamic construction of TradingView.TO alerts, sparing users the time and effort of mastering the TradingView.TO syntax and manually create alert commands.
This powerful tool gives much power to those who don't know how to code in Pinescript and want to automate their indicators' signals via TradingView.TO bot.
IMPORTANT NOTES
TradingView.TO is a trading bot software that forwards TradingView alerts to your brokers (examples: Binance, Oanda, Coinbase, Bybit, Metatrader 4/5, ...) for automating trading.
Many traders don't know how to create TradingView.TO dynamically-compatible alerts using the data from their TradingView scripts.
Traders using trading bots want their alerts to reflect the stop-loss/take-profit/trailing-stop/stop-loss to break options from your script and then create the orders accordingly.
This script showcases how to create TradingView.TO alerts dynamically.
TRADINGVIEW ALERTS
1) You'll have to create one alert per asset X timeframe = 1 chart.
Example: 1 alert for BTC/USDT on the 5 minutes chart, 1 alert for BTC/USDT on the 15-minute chart (assuming you want your bot to trade the BTC/USDT on the 5 and 15-minute timeframes)
2) Select the Order fills and alert() function calls condition
3) For each alert, the alert message is pre-configured with the text below
{{strategy.order.alert_message}}
Please leave it as it is.
It's a TradingView native variable that will fetch the alert text messages built by the script.
4) TradingView.TO uses webhook technology - setting a webhook URL from the alerts notifications tab is required.
KEY FEATURES
I) Modular Indicator Connection
* plug your existing indicator into the template.
* Only two lines of code are needed for full compatibility.
Step 1: Create your connector
Adapt your indicator with only 2 lines of code and then connect it to this strategy template.
To do so:
1) Find in your indicator where the conditions print the long/buy and short/sell signals.
2) Create an additional plot as below
I'm giving an example with a Two moving averages cross.
Please replicate the same methodology for your indicator, whether a MACD , ZigZag, Pivots , higher-highs, lower-lows or whatever indicator with clear buy and sell conditions.
//@version=5
indicator("Supertrend", overlay = true, timeframe = "", timeframe_gaps = true)
atrPeriod = input.int(10, "ATR Length", minval = 1)
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01)
= ta.supertrend(factor, atrPeriod)
supertrend := barstate.isfirst ? na : supertrend
bodyMiddle = plot(barstate.isfirst ? na : (open + close) / 2, display = display.none)
upTrend = plot(direction < 0 ? supertrend : na, "Up Trend", color = color.green, style = plot.style_linebr)
downTrend = plot(direction < 0 ? na : supertrend, "Down Trend", color = color.red, style = plot.style_linebr)
fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps = false)
buy = ta.crossunder(direction, 0)
sell = ta.crossunder(direction, 0)
//////// CONNECTOR SECTION ////////
Signal = buy ? 1 : sell ? -1 : 0
plot(Signal, title = "Signal", display = display.data_window)
//////// CONNECTOR SECTION ////////
Important Notes
🔥 The Strategy Template expects the value to be exactly 1 for the bullish signal and -1 for the bearish signal
Now, you can connect your indicator to the Strategy Template using the method below or that one.
Step 2: Connect the connector
1) Add your updated indicator to a TradingView chart
2) Add the Strategy Template as well to the SAME chart
3) Open the Strategy Template settings, and in the Data Source field, select your 🔌Connector🔌 (which comes from your indicator)
Note it doesn’t have to be named 🔌Connector🔌 - you can name it as you want - however, I recommend an explicit name you can easily remember.
From then, you should start seeing the signals and plenty of other stuff on your chart.
🔥 Note that whenever you update your indicator values, the strategy statistics and visuals on your chart will update in real-time
II) BOT Risk Management:
- Max Drawdown:
Mode: Select whether the max drawdown is calculated in percentage (%) or USD.
Value: If the max drawdown reaches this specified value, set a value to halt the bot.
- Max Consecutive Days:
Use Max Consecutive Days BOT Halt: Enable/Disable halting the bot if the max consecutive losing days value is reached.
- Max Consecutive Days: Set the maximum number of consecutive losing days allowed before halting the bot.
- Max Losing Streak:
Use Max Losing Streak: Enable/Disable a feature to prevent the bot from taking too many losses in a row.
- Max Losing Streak Length: Set the maximum length of a losing streak allowed.
Margin Call:
- Use Margin Call: Enable/Disable a feature to exit when a specified percentage away from a margin call to prevent it.
Margin Call (%): Set the percentage value to trigger this feature.
- Close BOT Total Loss:
Use Close BOT Total Loss: Enable/Disable a feature to close all trades and halt the bot if the total loss is reached.
- Total Loss ($): Set the total loss value in USD to trigger this feature.
Intraday BOT Risk Management:
- Intraday Losses:
Use Intraday Losses BOT Halt: Enable/Disable halting the bot on reaching specified intraday losses.
Mode: Select whether the intraday loss is calculated in percentage (%) or USD.
- Max Intraday Losses (%): Set the value for maximum intraday losses.
Limit Intraday Trades:
- Use Limit Intraday Trades: Enable/Disable a feature to limit the number of intraday trades.
- Max Intraday Trades: Set the maximum number of intraday trades allowed.
Restart Intraday EA:
III) Order Types and Position Sizing
- Choose between market or limit orders.
- Set your position size directly in the template.
Please use the position size from the “Inputs” and not the “Properties” tab.
I know it's redundant. - the template needs this value from the "Inputs" tab to build the alerts, and the Backtester needs it from the "Properties" tab.
IV) Advanced Take-Profit and Stop-Loss Options
- Choose to set your SL/TP in either USD or percentages.
- Option for multiple take-profit levels and trailing stop losses.
- Move your stop loss to break even +/- offset in USD for “risk-free” trades.
V) Miscellaneous:
Retry order openings if they fail.
Order Types:
Select and specify order type and price settings.
Position Size:
Define the type and size of positions.
Leverage:
Leverage settings, including margin type and hedge mode.
Session:
Limit trades to specific sessions.
Dates:
Limit trades to a specific date range.
Trades Direction:
Direction: Specify the market direction for opening positions.
VI) Logger
The TradingView.TO commands are logged in the TradingView logger.
You'll find more information about it in this TradingView blog post .
WHY YOU MIGHT NEED THIS TEMPLATE
1) Transform your indicator into a TradingView.TO trading bot more easily than before
Connect your indicator to the template
Create your alerts
Set your EA settings
2) Save Time
Auto-generated alert messages for TradingView.TO.
I tested them all and checked with the support team what could/couldn’t be done.
3) Be in Control
Manage your trading risks with advanced features.
4) Customizable
Fits various trading styles and asset classes.
REQUIREMENTS
* Make sure you have your TradingView.TO account
* If there is any issue with the template, ask me in the comments section - I’ll answer quickly.
BACKTEST RESULTS FROM THIS POST
1) I connected this strategy template to a dummy Supertrend script.
I could have selected any other indicator or concept for this script post.
I wanted to share an example of how you can quickly upgrade your strategy, making it compatible with TradingView.TO.
2) The backtest results aren't relevant for this educational script publication.
I used realistic backtesting data but didn't look too much into optimizing the results, as this isn't the point of why I'm publishing this script.
This strategy is a template to be connected to any indicator - the sky is the limit. :)
3) This template is made to take 1 trade per direction at any given time.
Pyramiding is set to 1 on TradingView.
The strategy default settings are:
* Initial Capital: 100000 USD
* Position Size: 1%
* Commission Percent: 0.075%
* Slippage: 1 tick
* No margin/leverage used
ProfitView Strategy TemplateHello traders,
This script took me a full week of coding/testing, sweat, and tears - and I’m too nice as I’m giving it for free to the community.
If you're tired of manual trading and looking for a solid strategy template to pair with your indicators, look no further.
This Pine Script v5 strategy template is engineered for maximum customization and risk management.
Best part?
This Pine Script v5 template facilitates the dynamic construction of ProfitView alerts, sparing users the time and effort of mastering the ProfitView syntax and manually creating alert commands.
This powerful tool gives much power to those who don't know how to code in Pinescript and want to automate their indicators' signals via the ProfitView Chrome extension.
IMPORTANT NOTES
ProfitView is a trading bot software that forwards TradingView alerts to your brokers (examples: Binance, Oanda, Coinbase, Bybit, etc.) for automating trading.
Many traders don't know how to dynamically create ProfitView-compatible alerts using the data from their TradingView scripts.
Traders using trading bots want their alerts to reflect the stop-loss/take-profit/trailing-stop/stop-loss to break options from your script and then create the orders accordingly.
This script showcases how to create ProfitView alerts dynamically.
TRADINGVIEW ALERTS
1) You'll have to create one alert per asset X timeframe = 1 chart.
Example: 1 alert for EUR/USD on the 5 minutes chart, 1 alert for EUR/USD on the 15-minute chart (assuming you want your bot to trade the EUR/USD on the 5 and 15-minute timeframes)
2) Select the Order fills and alert() function calls condition
3) For each alert, the alert message is pre-configured with the text below
{{strategy.order.alert_message}}
Please leave it as it is.
It's a TradingView native variable that will fetch the alert text messages built by the script.
4) ProfitView doesn't use webhook technology, so setting a webhook URL from the alerts notifications tab is unnecessary.
KEY FEATURES
I) Modular Indicator Connection
* plug your existing indicator into the template.
* Only two lines of code are needed for full compatibility.
Step 1: Create your connector
Adapt your indicator with only 2 lines of code and then connect it to this strategy template.
To do so:
1) Find in your indicator where the conditions print the long/buy and short/sell signals.
2) Create an additional plot as below
I'm giving an example with a Two moving averages cross.
Please replicate the same methodology for your indicator, whether a MACD , ZigZag, Pivots , higher-highs, lower-lows or whatever indicator with clear buy and sell conditions.
//@version=5
indicator("Supertrend", overlay = true, timeframe = "", timeframe_gaps = true)
atrPeriod = input.int(10, "ATR Length", minval = 1)
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01)
= ta.supertrend(factor, atrPeriod)
supertrend := barstate.isfirst ? na : supertrend
bodyMiddle = plot(barstate.isfirst ? na : (open + close) / 2, display = display.none)
upTrend = plot(direction < 0 ? supertrend : na, "Up Trend", color = color.green, style = plot.style_linebr)
downTrend = plot(direction < 0 ? na : supertrend, "Down Trend", color = color.red, style = plot.style_linebr)
fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps = false)
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps = false)
buy = ta.crossunder(direction, 0)
sell = ta.crossunder(direction, 0)
//////// CONNECTOR SECTION ////////
Signal = buy ? 1 : sell ? -1 : 0
plot(Signal, title = "Signal", display = display.data_window)
//////// CONNECTOR SECTION ////////
Important Notes
🔥 The Strategy Template expects the value to be exactly 1 for the bullish signal and -1 for the bearish signal
Now, you can connect your indicator to the Strategy Template using the method below or that one.
Step 2: Connect the connector
1) Add your updated indicator to a TradingView chart
2) Add the Strategy Template as well to the SAME chart
3) Open the Strategy Template settings, and in the Data Source field, select your 🔌Connector🔌 (which comes from your indicator)
Note it doesn’t have to be named 🔌Connector🔌 - you can name it as you want - however, I recommend an explicit name you can easily remember.
From then, you should start seeing the signals and plenty of other stuff on your chart.
🔥 Note that whenever you update your indicator values, the strategy statistics and visuals on your chart will update in real-time
II) BOT Risk Management:
- Max Drawdown:
Mode: Select whether the max drawdown is calculated in percentage (%) or USD.
Value: If the max drawdown reaches this specified value, set a value to halt the bot.
- Max Consecutive Days:
Use Max Consecutive Days BOT Halt: Enable/Disable halting the bot if the max consecutive losing days value is reached.
- Max Consecutive Days: Set the maximum number of consecutive losing days allowed before halting the bot.
- Max Losing Streak:
Use Max Losing Streak: Enable/Disable a feature to prevent the bot from taking too many losses in a row.
- Max Losing Streak Length: Set the maximum length of a losing streak allowed.
Margin Call:
- Use Margin Call: Enable/Disable a feature to exit when a specified percentage away from a margin call to prevent it.
Margin Call (%): Set the percentage value to trigger this feature.
- Close BOT Total Loss:
Use Close BOT Total Loss: Enable/Disable a feature to close all trades and halt the bot if the total loss is reached.
- Total Loss ($): Set the total loss value in USD to trigger this feature.
Intraday BOT Risk Management:
- Intraday Losses:
Use Intraday Losses BOT Halt: Enable/Disable halting the bot on reaching specified intraday losses.
Mode: Select whether the intraday loss is calculated in percentage (%) or USD.
- Max Intraday Losses (%): Set the value for maximum intraday losses.
Limit Intraday Trades:
- Use Limit Intraday Trades: Enable/Disable a feature to limit the number of intraday trades.
- Max Intraday Trades: Set the maximum number of intraday trades allowed.
Restart Intraday EA:
- Use Restart Intraday EA: Enable/Disable a feature to restart the bot at the first bar of the next day if it has been stopped with an intraday risk management safeguard.
III) Order Types and Position Sizing
- Choose between market, limit, or stop orders.
- Set your position size directly in the template.
Please use the position size from the “Inputs” and not the “Properties” tab.
I know it's redundant. - the template needs this value from the "Inputs" tab to build the alerts, and the Backtester needs it from the "Properties" tab.
IV) Advanced Take-Profit and Stop-Loss Options
- Choose to set your SL/TP in either pips or percentages.
- Option for multiple take-profit levels and trailing stop losses.
- Move your stop loss to break even +/- offset in pips for “risk-free” trades.
V) Miscellaneous
Retry order openings if they fail.
Order Types:
Select and specify order type and price settings.
Position Size:
Define the type and size of positions.
Leverage:
Leverage settings, including margin type and hedge mode.
Session:
Limit trades to specific sessions.
Dates:
Limit trades to a specific date range.
Trades Direction:
Direction: Specify the market direction for opening positions.
VI) Notifications (Telegram/Discord/Email/IFTTT/Twilio/SMS)
Customize notifications sent to Telegram, Discord, Email, IFTTT, Twilio, and ProfitView Logger.
VII) Logger
The ProfitView commands are logged in the TradingView logger.
You'll find more information about it in this TradingView blog post .
WHY YOU MIGHT NEED THIS TEMPLATE
1) Transform your indicator into a ProfitView trading bot more easily than before
Connect your indicator to the template
Create your alerts
Set your EA settings
2) Save Time
Auto-generated alert messages for ProfitView.
I tested them all and checked with the support team what could/couldn’t be done.
3) Be in Control
Manage your trading risks with advanced features.
4) Customizable
Fits various trading styles and asset classes.
REQUIREMENTS
* Make sure you have your ProfitView account and do the settings correctly in your Chrome extension. If you don't know how to do it, read the documentation + ask for help in the ProfitView Discord support channel.
* If there is any issue with the template, ask me in the comments section - I’ll answer quickly.
BACKTEST RESULTS FROM THIS POST
1) I connected this strategy template to a dummy Supertrend script.
I could have selected any other indicator or concept for this script post.
I wanted to share an example of how you can quickly upgrade your strategy, making it compatible with ProfitView.
2) The backtest results aren't relevant for this educational script publication.
I used realistic backtesting data but didn't look too much into optimizing the results, as this isn't the point of why I'm publishing this script.
This strategy is a template to be connected to any indicator - the sky is the limit. :)
3) This template is made to take 1 trade per direction at any given time.
Pyramiding is set to 1 on TradingView.
The strategy default settings are:
* Initial Capital: 100000 USD
* Position Size: 1%
* Commission Percent: 0.075%
* Slippage: 1 tick
* No margin/leverage used
Best regards,
Dave
Golden Vector Trend Orchestrator (GVTO)Golden Vector Trend Orchestrator (GVTO) is a composite trend-following strategy specifically engineered for XAUUSD (Gold) and volatile assets on H4 (4-Hour) and Daily timeframes.
This script aims to solve a common problem in trend trading: "Whipsaws in Sideways Markets." Instead of relying on a single indicator, GVTO employs a Multi-Factor Confluence System that filters out low-probability trades by requiring alignment across Trend Structure, Momentum, and Volatility.
🛠 Methodology & Logic
The strategy executes trades only when four distinct technical conditions overlap (Confluence). If any single condition is not met, the trade is filtered out to preserve capital.
1. Market Structure Filter (200 EMA)
Indicator: Exponential Moving Average (Length 200).
Logic: The 200 EMA acts as the baseline for the long-term trend regime.
Bullish Regime: Price must close above the 200 EMA.
Bearish Regime: Price must close below the 200 EMA.
Purpose: Prevents counter-trend trading against the macro direction.
2. Signal Trigger & Trailing Stop (Supertrend)
Indicator: Supertrend (ATR Length 14, Factor 3.5).
Logic: Uses Average True Range (ATR) to detect trend reversals while accounting for volatility.
Purpose: Provides the specific entry signal and acts as a dynamic trailing stop-loss to let profits run while cutting losses when the trend invalidates.
3. Volatility Gatekeeper (ADX Filter)
Indicator: Average Directional Index (Length 14).
Threshold: > 25.
Logic: A high ADX value indicates a strong trend presence, regardless of direction.
Purpose: This is the most critical filter. It prevents the strategy from entering trades during "choppy" or ranging markets (consolidation zones) where trend-following systems typically fail.
4. Momentum Confirmation (DMI)
Indicator: Directional Movement Index (DI+ and DI-).
Logic: Checks if the buying pressure (DI+) is physically stronger than selling pressure (DI-), or vice versa.
Purpose: Ensures that the price movement is backed by genuine momentum, not just a momentary price spike.
📋 How to Use This Strategy
🟢 LONG (BUY) Setup
A Buy signal is generated only when ALL of the following occur simultaneously:
Price Action: Price closes ABOVE the 200 EMA (Orange Line).
Trigger: Supertrend flips to GREEN (Bullish).
Strength: ADX is greater than 25 (Strong Trend).
Momentum: DI+ (Plus Directional Indicator) is greater than DI- (Minus).
🔴 SHORT (SELL) Setup
A Sell signal is generated only when ALL of the following occur simultaneously:
Price Action: Price closes BELOW the 200 EMA (Orange Line).
Trigger: Supertrend flips to RED (Bearish).
Strength: ADX is greater than 25 (Strong Trend).
Momentum: DI- (Minus Directional Indicator) is greater than DI+ (Plus).
🛡 Exit Strategy
Stop Loss / Take Profit: The strategy utilizes the Supertrend Line as a dynamic Trailing Stop.
Exit Long: When Supertrend turns Red.
Exit Short: When Supertrend turns Green.
Note: Traders can also use the real-time P/L Dashboard included in the script to manually secure profits based on their personal Risk:Reward ratio.
📊 Included Features
Real-Time P/L Dashboard: A table in the top-right corner displays the current trend status, ADX strength, and the Unrealized Profit/Loss % of the current active position.
Smart Labeling: Buy/Sell labels are coded to appear only on the initial entry trigger. They do not repaint and do not spam the chart if the trend continues (no pyramiding visualization).
Visual Aids: Background color changes (Green/Red) to visually represent the active trend based on the Supertrend status.
⚠️ Risk Warning & Best Practices
Asset Class: Optimized for XAUUSD (Gold) due to its high volatility nature. It also works well on Crypto (BTC, ETH) and Major Forex Pairs.
Timeframe: Highly recommended for H4 (4 Hours) or D1 (Daily). Using this on lower timeframes (M5, M15) may result in false signals due to market noise.
News Events: Automated strategies cannot predict economic news (CPI, NFP). Exercise caution or pause trading during high-impact economic releases.






















